package com.mq.enm;

import org.springframework.jms.annotation.JmsListener;  
import org.springframework.messaging.handler.annotation.SendTo;  
import org.springframework.stereotype.Component;  
 

/**
 * 消息消费者2
 * @author P0114255
 *
 */
@Component  
public class Consumer2 {  
  
	//注解@SendTo("out.queue")，该注解的意思是将return回的值，再发送的"out.queue"队列中，
    @JmsListener(destination = "mytest.queue")  
    @SendTo("out.queue")  
    public String receiveQueue(String text) {  
        System.out.println("Consumer2收到的报文为:"+text);  
        return "return message"+text;  
    }  
} 
